% 定义 OutputFcn 回调函数
function stop = outputFunction(optimValues, state)
    global bestPositionsHistory
    if strcmp(state, 'iter')
        bestPositionsHistory = [bestPositionsHistory; optimValues.bestx];
    end
    stop = false;
end